package com.gcb.util;

import java.net.MalformedURLException;
import java.net.URL;

import org.codehaus.xfire.client.Client;

public class WsdlUtil {
	public boolean qqCheckOnline(String qq) {
		Client c;
		try {
			c = new Client(
					new URL(
							"http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl"));
			Object[] o = c.invoke("qqCheckOnline", new String[] { qq });
			String flag = (String) o[0];
			if ("Y".equals(flag)) {
				return true;
			}
			return false;
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}
	
	public static void main(String[] args) {
		WsdlUtil wu = new WsdlUtil();
		System.out.println(wu.qqCheckOnline("523001140"));
	}
}
